package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Set;

/**
 * 用户实体类
 */
@TableName("t_user")
public class UserBean {
    //    用户编号
    @TableId(value = "pk_userId", type = IdType.AUTO)
    private Integer id;

    //    用户名
    @TableField("u_userName")
    private String userName;

    //    密码
    @TableField("u_passWord")
    private String passWord = "123";

    //    真实姓名
    @TableField("u_name")
    private String name;

    //    角色集合
    @TableField(exist = false)
    private Set<RoleBean> role;

    //    权限集合
    @TableField(exist = false)
    private Set<GradeBean> grade;

    public UserBean() {
    }

    public UserBean(String userName, String passWord, String name) {
        this.userName = userName;
        this.passWord = passWord;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Set<RoleBean> getRole() {
        return role;
    }

    public void setRole(Set<RoleBean> role) {
        this.role = role;
    }

    public Set<GradeBean> getGrad() {
        return grade;
    }

    public void setGrad(Set<GradeBean> grad) {
        this.grade = grad;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", passWord='" + passWord + '\'' +
                ", name='" + name + '\'' +
                ", role=" + role +
                ", grad=" + grade +
                '}';
    }
}
